#include <vector>
#include <unordered_map>

using namespace std;

class Solution
{
public:
    int singleNumber(vector<int> &nums)
    {
        unordered_map<int, int> tmp;
        for (auto x : nums)
        {
            ++tmp[x];
        }
        int ret = 0;
        for (auto[x, y] : tmp)
        {
            if (y == 1)
            {
                ret = x;
                break;
            }
        }
        return ret;
    }
};